Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Keystroke programming</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Keystroke_programming"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Keystroke_programming rootpage-Keystroke_programming skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Keystroke programming</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r1251242444">
/* start https://en.wikipedia.org/ */


.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}


/* end https://en.wikipedia.org/ */
</style>
<p><b>Keystroke programming</b> describes a specific way of programming by which each keystroke on a device or application is recorded in some way and then played back so that the recorded key-presses can be repeated multiple times. Keystroke programming is most commonly but not exclusively found in <a href="Programmable_calculator" title="Programmable calculator">programmable calculators</a>—there are keystroke-programmable software applications, too, such as <a href="Vim_(text_editor)" title="Vim (text editor)">Vim</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="TI_calculator_example">TI calculator example</h2></div>

<p>The Texas Instruments <a href="TI-59_/_TI-58" title="TI-59 / TI-58">TI-58/TI-58C/TI-59</a> calculators were programmable, and program storage took the form of a sequence of codes which (mostly) corresponded to the position of keys on the calculator keypad. Here is a simplified diagram of the basic key layout:
</p>
<table class="wikitable" style="background-color:#000000;">

<tbody><tr>
<th>&nbsp;</th>
<th><i>x</i>1</th>
<th><i>x</i>2</th>
<th><i>x</i>3</th>
<th><i>x</i>4</th>
<th><i>x</i>5
</th></tr>
<tr>
<th>1<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;A&nbsp;</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;B&nbsp;</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;C&nbsp;</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;D&nbsp;</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;E&nbsp;</span>
</td></tr>
<tr>
<th>2<i>x</i>
</th>
<td><span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">2nd</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">INV</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">ln<i>x</i></span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">CE</span></td>
<td><span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">CLR</span>
</td></tr>
<tr>
<th>3<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">LRN</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">x⇌t</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">x<sup>2</sup></span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d"><span class="nowrap">√<span style="border-top:1px solid; padding:0 0.1em;">x</span></span></span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">1/x</span>
</td></tr>
<tr>
<th>4<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">SST</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">STO</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">RCL</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">SUM</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">y<sup>x</sup></span>
</td></tr>
<tr>
<th>5<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">BST</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">EE</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;(&nbsp;</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;)&nbsp;</span></td>
<td><span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">&nbsp;÷&nbsp;</span>
</td></tr>
<tr>
<th>6<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">GTO</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;7&nbsp;</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;8&nbsp;</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;9&nbsp;</span></td>
<td><span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">&nbsp;×&nbsp;</span>
</td></tr>
<tr>
<th>7<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">SBR</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;4&nbsp;</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;5&nbsp;</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;6&nbsp;</span></td>
<td><span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">&nbsp;-&nbsp;</span>
</td></tr>
<tr>
<th>8<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">RST</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;1&nbsp;</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;2&nbsp;</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;3&nbsp;</span></td>
<td><span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">&nbsp;+&nbsp;</span>
</td></tr>
<tr>
<th>9<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">R/S</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;0&nbsp;</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;.&nbsp;</span></td>
<td><span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">+/-</span></td>
<td><span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">&nbsp;=&nbsp;</span>
</td></tr>
</tbody></table>
<p>Each key is assigned a two-digit code; for most (but not all) keys, the tens digit comes from the row number (as indicated down the left of the table) and the units digit comes from the column number (as indicated across the top of the table).
</p><p>Now consider a very simple program, which adds 2 to the number being displayed, and then stops. The program is entered starting from program location 000, and looks like this:
</p>
<table class="wikitable">

<tbody><tr>
<th>Location</th>
<th>Contents</th>
<th>Meaning</th>
<th>Comments
</th></tr>
<tr>
<td>000</td>
<td>85</td>
<td>+</td>
<td>
</td></tr>
<tr>
<td>001</td>
<td>02</td>
<td>2</td>
<td>
</td></tr>
<tr>
<td>002</td>
<td>95</td>
<td>=</td>
<td>compute result
</td></tr>
<tr>
<td>003</td>
<td>91</td>
<td>R/S</td>
<td>stop program
</td></tr>
</tbody></table>
<p>To use this program, you would enter the number <i>n</i> to be operated on, press <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">RST</span> to ensure the current program location was 000, then <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">R/S</span> to start execution. When the program stops (which should happen quite quickly for such a simple program), the display will be showing the number <i>n</i> + 2.
</p><p>You can see that the codes 85, 95 and 91 correspond to the positions of the keys labelled <span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">&nbsp;+&nbsp;</span>, <span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">&nbsp;=&nbsp;</span> and <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">R/S</span> on the grid above, but the code for the <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;2&nbsp;</span> is not 83 as you would expect from the grid position, but 02. This last code was chosen to be more easily understandable by a human trying to read the program. There is no row 0, so the codes 00 .. 09 are used to represent the keys <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;0&nbsp;</span> .. <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;9&nbsp;</span>.
</p>
<div class="mw-heading mw-heading3"><h3 id="Context-dependent_interpretations">Context-dependent interpretations</h3></div>
<p>These TI calculators allowed for addressing up to 100 data memory locations, numbered 00 to 99 (some models had a lower limit than this). A keystroke sequence like <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">STO</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;4&nbsp;</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;2&nbsp;</span> (store the currently-displayed number into memory 42) would be encoded as 42 42. In this case the first 42 is the key code for the <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">STO</span> key, but the second 42 is not a key code, but a memory register number. The calculator knows to interpret it as such because that's what has to follow the code for the <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">STO</span> key.
</p><p>Program addresses were 3 digits, potentially allowing programs to consist of up to 1000 steps, numbered 000 to 999 (though in fact none of the models produced allowed for this maximum). A branch instruction, for example <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">GTO</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;3&nbsp;</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;4&nbsp;</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;5&nbsp;</span> (unconditional branch to location 345) would be encoded as 61 03 45. In this case the hundreds digit of the branch destination is in the units digit of the second instruction byte (after the opcode), with a zero tens digit; and the remaining digits are in the third instruction byte.
</p><p>A code sequence like 61 11, on the other hand, represents the keystrokes <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">GTO</span> <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;A&nbsp;</span>, which is a branch to the location marked by the <i>symbolic label</i> <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">&nbsp;A&nbsp;</span>. The calculator can tell this is a symbolic branch, rather than a branch to a numbered location, because the tens digit of the byte immediately following the opcode is not zero.
</p><p>Most of the keys on the keypad can be used as symbolic labels. For example, sequences like <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">GTO</span> <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">STO</span> and <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">GTO</span> <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">GTO</span> are legitimate, provided that <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">STO</span> and <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">GTO</span> have in fact been defined as labels somewhere in the program.
</p>
<div class="mw-heading mw-heading3"><h3 id="Modifier_keys">Modifier keys</h3></div>
<p>Most of the keys had multiple functions, depending on whether <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">INV</span> or <span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">2nd</span> had been pressed beforehand. <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">INV</span> invoked the "inverse" (whatever that meant) of the following function, and was recorded in a program as a separate keystroke (code 22), while <span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">2nd</span> invoked a completely different function which was written on the keypad faceplate just above the key. For example, pressing <span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">2nd</span> <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">x<sup>2</sup></span> invoked the <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">sin</span> function, while <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">INV</span> <span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">2nd</span> <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">x<sup>2</sup></span> (or <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">INV</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">sin</span>) gave you the arcsine.
</p><p>The code for this alternate function is derived from that of the original key function by adding 5 to the units digit (<i>without</i> carry to the tens digit). Thus, the key codes corresponding to the position of the <span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">2nd</span> key itself (21 and 26) are never used as opcodes. Here is the table of the codes produced with the <span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">2nd</span> prefix:
</p>
<table class="wikitable" style="background-color:#000000;">

<tbody><tr>
<th>&nbsp;</th>
<th><i>x</i>6</th>
<th><i>x</i>7</th>
<th><i>x</i>8</th>
<th><i>x</i>9</th>
<th><i>x</i>0
</th></tr>
<tr>
<th>1<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">&nbsp;A'&nbsp;</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">&nbsp;B'&nbsp;</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">&nbsp;C'&nbsp;</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">&nbsp;D'&nbsp;</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">&nbsp;E'&nbsp;</span>
</td></tr>
<tr>
<th>2<i>x</i>
</th>
<td>&nbsp;</td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">INV</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">log</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">CP</span></td>
<td><span style="background:#cc9858;padding:1pt;border:1pt solid black;font-weight:bold">CLR</span>
</td></tr>
<tr>
<th>3<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Pgm</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">P→R</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">sin</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">cos</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">tan</span>
</td></tr>
<tr>
<th>4<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ins</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">CMs</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Exc</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Prd</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span>
</td></tr>
<tr>
<th>5<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Del</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Eng</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Fix</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Int</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">|x|</span>
</td></tr>
<tr>
<th>6<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Pause</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">x=t</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Nop</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Op</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Deg</span>
</td></tr>
<tr>
<th>7<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Lbl</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">x≥t</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Σx</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">mean(x)</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Rad</span>
</td></tr>
<tr>
<th>8<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">St flg</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">If flg</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">D.MS</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">π</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Grad</span>
</td></tr>
<tr>
<th>9<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Write</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Dsz</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Adv</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Prt</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">List</span>
</td></tr>
</tbody></table>
<div class="mw-heading mw-heading3"><h3 id="Merged_keystrokes">Merged keystrokes</h3></div>
<p>The <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span> key allows for indirection: wherever a reference to a memory register or a program location is allowed, this key can be used to fetch the actual value from a memory register. For example, the key sequence <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">RCL</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;1&nbsp;</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;0&nbsp;</span> means to fetch the value in memory register 10, and use that value in turn as the number of a memory register whose contents are to be fetched as the current operand. However, in this case the <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span> cannot be encoded as code 40, because the code sequence 43 40 would be interpreted as <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">RCL</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;4&nbsp;</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;0&nbsp;</span>, not <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">RCL</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span>.
</p><p>But, because of the use of the 00 .. 09 codes for the <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;0&nbsp;</span> .. <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;9&nbsp;</span> keys, the codes 62-64, 72-74, 82-84 and 92 are available for other uses. So most of these are reallocated to represent <i>op</i> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span> sequences:
</p>
<table class="wikitable" style="background-color:#000000;">

<tbody><tr>
<th>&nbsp;</th>
<th><i>x</i>2</th>
<th><i>x</i>3</th>
<th><i>x</i>4
</th></tr>
<tr>
<th>6<i>x</i>
</th>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Pgm</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Exc</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Prd</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span>
</td></tr>
<tr>
<th>7<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">STO</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">RCL</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span></td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">SUM</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span>
</td></tr>
<tr>
<th>8<i>x</i>
</th>
<td>&nbsp;</td>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">GTO</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span></td>
<td><span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Op</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span>
</td></tr>
<tr>
<th>9<i>x</i>
</th>
<td><span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">INV</span> <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">SBR</span></td>
<td>&nbsp;</td>
<td>&nbsp;
</td></tr>
</tbody></table>
<p>Thus, the key sequence <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">RCL</span> <span style="background:#222424;padding:1.5pt;font-weight:bold;color:#bdaa7d">Ind</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;1&nbsp;</span> <span style="background:#bdaa7d;padding:1pt;border:1pt solid black;font-weight:bold;color:#222424">&nbsp;0&nbsp;</span> would be encoded as 73 10.
</p><p>Note the use of code 92 for <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">INV</span> <span style="background:#4e3836;padding:1pt;border:1pt solid black;font-weight:bold;color:#bdaa7d">SBR</span> (return from subroutine); this was not necessary for reasons of ambiguity, but was done to save space with such a common sequence.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="FOCAL_keystroke_programming" class="mw-redirect" title="FOCAL keystroke programming">FOCAL keystroke programming</a></li>
<li><a href="Macro_recorder" title="Macro recorder">Macro recorder</a></li>
<li><a href="Programming_by_demonstration" title="Programming by demonstration">Programming by demonstration</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://vimdoc.sourceforge.net/htmldoc/repeat.html#complex-repeat">"Vim documentation: Repeat"</a>.</cite></span>
</li>
</ol></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-03-19" href="https://en.wikipedia.org/wiki/?title=Keystroke_programming&amp;oldid=1281313517">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>